<template>
  <div>
    <!-- 查询 -->
    <keep-alive>
      <div class="search">
        <a-row style="align-items: center" :gutter="20">
          <a-col :span="3" :offset="1" :lg="3" :xs="21">
            <span class="user-title">订单状态:</span>
          </a-col>
          <a-col
            :span="2"
            :md="4"
            :lg="2"
            :xs="6"
            class="user-status"
            v-for="(item, index) in orderStatus"
            :class="item.status == orderStatusAct ? 'user-status-act' : ''"
            @click="chooseOrderStatus(item, index)"
            :key="index"
          >
            <div class="item-title">{{ item.title }}</div>
          </a-col>
        </a-row>
        <div style="height: 30px"></div>
        <a-form :rules="rules" :model="form" :hideRequiredMark="true" :label-col="labelCol">
          <a-row :gutter="20" :wrap="true">
            <a-col :span="5" :md="8" :lg="5" :xs="12">
              <a-form-item label="订单号">
                <a-input v-model:value="form.number" placeholder="请输入订单号" allow-clear></a-input>
              </a-form-item>
            </a-col>
            <a-col :span="5" :md="8" :lg="5" :xs="12">
              <a-form-item label="用户姓名">
                <a-input v-model:value="form.userName" placeholder="请输入 用户姓名" allow-clear></a-input>
              </a-form-item>
            </a-col>
            <a-col :span="5" :md="8" :lg="5" :xs="12">
              <a-form-item label="用户ID">
                <a-input v-model:value="form.userId" placeholder="请输入用户ID" allow-clear></a-input>
              </a-form-item>
            </a-col>
            <a-col :span="5" :md="8" :lg="5" :xs="12">
              <a-form-item label="用户手机号">
                <a-input v-model:value="form.mobile" placeholder="请输入用户手机号" allow-clear></a-input>
              </a-form-item>
            </a-col>
            <!-- 设置这个可以换行:xs="8" :sm="8" -->
            <a-col :span="2" @click="search" :md="5" :lg="2" :xs="5">
              <a-form-item>
                <a-button type="primary" class="d-a-center">搜索</a-button>
              </a-form-item>
            </a-col>
            <a-col :span="2" :md="4" :lg="2" :xs="4">
              <a-button type="info" @click="openDrawer" class="d-a-center">高级筛选</a-button>
            </a-col>
          </a-row>
        </a-form>
      </div>
    </keep-alive>

    <!--订单列表 v-if="checkPermission(['editor'])" -->
    <div style="margin: 20px 0px" class="df">
      <a-button type="primary" @click="excleData" v-has="{ a: $route, b: 2 }" class="d-a-center">导出数据</a-button>
      <a-button style="margin-left: 30px" type="primary" @click="handleOrderPop" v-has="{ a: $route, b: 2 }" class="d-a-center"
        >新增订单
      </a-button>
      <a-button style="margin-left: 30px" type="primary" @click="handleTelPop" v-has="{ a: $route, b: 2 }" class="d-a-center"
        >设置手机号
      </a-button>
      <a-button style="margin-left: 30px" type="primary" @click="uploadVisible = true" class="d-a-center">导入订单 </a-button>
      <!-- <a-upload v-model:file-list="fileList" :maxCount="1" name="file" @change="handleChange1" :action="action" accept=".xls,xlsx">
        <a-button style="margin-left: 30px" class="d-a-center">
          <upload-outlined></upload-outlined>
          导入订单
        </a-button>
      </a-upload> -->
    </div>
    <a-table
      rowKey="id"
      :columns="colums"
      :data-source="list"
      bordered
      :loading="loading"
      :pagination="pagination"
      @change="handleTableChange"
      :row-selection="rowSelection"
      :scrollToFirstRowOnChange="true"
    >
      <!-- :scroll="{ y: 540, x: 'auto' }" -->

      <template #price="{ record }">
        <!-- :style="'color' + orderListStatusColor(record.status)" -->
        <div>
          {{ (Number(record.price) + Number(record.consumablePrice) + Number(record.nightPrice)).toFixed(2) }}
        </div>
      </template>

      <!-- 订单状态显示 -->
      <template #status="{ record }">
        <!-- :style="'color' + orderListStatusColor(record.status)" -->
        <div v-if="record.status != 7">
          <a-tag :color="orderListStatusColor(record.status)">{{ orderListStatus(record.status) }}</a-tag>
        </div>
        <div v-else>
          <a-tag color="blue">{{ record.refundStatus == 1 ? '部分退款' : '全额退款' }}</a-tag>
        </div>
      </template>
      <template #callStatus="{ record }">
        <div>
          {{ ['未通话', '已通话'][record.callStatus] }}
        </div>
      </template>
      <template #isShow="{ record, index }">
        <!--  v-has="{a:$route,b:2}" -->
        <div @click="changeStack(record.isShow, index, record.key)">
          <a-switch v-model:checked="record.isShow" :checkedValue="0" :unCheckedValue="3" />
        </div>
      </template>
      <!-- <template #isShow="{ record }">
        <div>
          
          <a-tag :color="record.isShow==3? 'blue' : 'success'">{{ record.isShow==3? '不可抢' : '可抢' }}</a-tag>
        </div>
      </template> -->

      <template #operation="{ record }">
        <div style="display: flex; flex-wrap: wrap; min-width: 100px">
          <a-button
            v-if="record.status <= 4"
            type="link"
            @click="deal(record.number, record.status, 1, listStatus, listPage, form, advancedForm)"
            v-has="{ a: $route, b: 2 }"
            >处理</a-button
          >
          <a-button
            type="link"
            @click="look(record.number, record.status, 0, listStatus, listPage, form, advancedForm)"
            v-has="{ a: $route, b: 1 }"
            >查看
          </a-button>
          <a-button
            v-if="record.status != 1"
            type="link"
            @click="
              editStatus(
                record.aiPuDiKangNumber,
                record.createdAt,
                record.serveNumber,
                record.number,
                record.status,
                record.calculatePrice,
                record.institution,
                record.isEditNeed,
                record.scheduleTime,
                record.price,
                record.address,
                0
              )
            "
            v-has="{ a: $route, b: 2 }"
            >编辑</a-button
          >
        </div>
      </template>
    </a-table>
    <!-- 修改手机号 -->
    <a-modal v-model:visible="telVisible" title="修改手机号" @ok="handleTel">
      当前值班手机：{{ mytel1 }}
      <a-input v-model:value="mytel" placeholder="请输入新的值班手机号"></a-input>
    </a-modal>
    <!-- 修改订单状态 -->
    <a-modal v-model:visible="editVisible" title="修改订单信息" @ok="saveStatus">
      <a-form :label-col="labelCol" :model="editListInfo">
        <a-form-item label="订单状态">
          <a-select ref="select" v-model:value="editListInfo.status" @focus="focus" placeholder="请选择订单状态">
            <a-select-option v-for="item in orderStatus" :value="item.status" :key="item.status">
              <div v-if="item.status != 0">{{ item.title }}</div>
            </a-select-option>
          </a-select>
        </a-form-item>
        <block v-if="editListInfo.isEditNeed == 1">
          <a-form-item label="订单金额">
            <a-input-number placeholder="请输入订单金额" style="width: 100%" allow-clear v-model:value="editListInfo.price" />
          </a-form-item>
          <a-form-item label="应结金额">
            <a-input-number placeholder="请输入应结金额" style="width: 100%" allow-clear v-model:value="editListInfo.calculatePrice" />
          </a-form-item>
        </block>
        <a-form-item label="渠道名称">
          <a-input v-model:value="editListInfo.institution" placeholder="请输入渠道名称"></a-input>
        </a-form-item>
        <block v-if="editListInfo.serveNumber == 1">
          <a-form-item label="服务时间">
            <a-date-picker show-time valueFormat="YYYY/MM/DD HH:mm:ss" v-model:value="editListInfo.scheduleTime" />
          </a-form-item>
        </block>
        <a-form-item label="所在城市">
          <a-input v-model:value="editListInfo.descAddress" style="width: 100%" disabled></a-input>
        </a-form-item>
        <a-form-item label="详细地址">
          <a-input v-model:value="editListInfo.address" style="width: 100%" placeholder="请输入服务地址"></a-input>
        </a-form-item>

        <div v-if="editListInfo.serveNumber > 1">
          <div v-for="(item, index) in editListInfo.ordersList" :key="index">
            <div style="width: 90%" class="mar">订单编号{{ item.number }}</div>
            <a-form-item label="" style="width: 95%; margin-left: 5%">
              <block v-if="item.status == 5"> 完成时间{{ item.scheduleTime }} </block>
              <block v-else>
                <a-date-picker show-time valueFormat="YYYY/MM/DD HH:mm:ss" v-model:value="item.scheduleTime" />
              </block>
            </a-form-item>
          </div>
        </div>
      </a-form>
    </a-modal>

    <!-- 导入订单 -->
    <uploadOrder v-model:visible="uploadVisible" @success="emitOrder" />

    <!-- 高级筛选抽屉 -->
    <a-drawer width="45%" v-model:visible="visible" class="custom-class" title="高级筛选" placement="right" @close="close" destroyOnClose>
      <a-form :label-col="labelCol" :model="advancedForm">
        <a-form-item label="服务名称">
          <a-input v-model:value="advancedForm.serviceName" placeholder="请输入服务名称"></a-input>
        </a-form-item>
        <a-form-item label="服务地址">
          <a-input v-model:value="advancedForm.address" placeholder="请输入服务地址"></a-input>
        </a-form-item>
        <a-form-item label="订单金额">
          <!-- <a-slider
            v-model:value="sliderValue"
            @change="changeOrderNumber"
            range
            :min="0"
            :max="1000"
            :marks="marks"
            tooltipVisible
          /> -->
          <a-input-number
            style="width: 100px; text-align: center"
            placeholder="最低金额"
            :min="0"
            allow-clear
            v-model:value="advancedForm.startPrice"
          />
          <a-input style="width: 30px; border-left: 0; pointer-events: none; background-color: #fff" placeholder="~" disabled />
          <!-- :min="maxPrice" -->
          <a-input-number
            :maxLength="5"
            :min="maxPrice"
            allow-clear
            v-model:value="advancedForm.endPrice"
            style="width: 100px; text-align: center; border-left: 0"
            placeholder="最大金额"
          />
        </a-form-item>
        <a-form-item label="渠道名称">
          <a-select mode="multiple" ref="select" v-model:value="advancedForm.channel" @change="handleChange" placeholder="请选择">
            <a-select-option v-for="item in channel" :value="item.id" :key="item.id">{{ item.name }} </a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item label="下单时间">
          <a-range-picker v-model:value="orderTime" showTime @change="selectTime" style="width: 100%" format="YYYY-MM-DD HH:mm:ss" />
        </a-form-item>
        <a-form-item label="订单数量">
          <!-- <a-slider
            v-model:value="advancedForm.serveNumber"
            @change="changeOrderNumber"
            :marks="marks"
          /> -->
          <a-input-number v-model:value="advancedForm.serveNumber" placeholder="" :min="1"></a-input-number>
        </a-form-item>
        <a-form-item label="抢单">
          <a-select ref="select" v-model:value="advancedForm.isShow" @change="handleChange" placeholder="请选择">
            <a-select-option v-for="item in mystatus" :value="item.id" :key="item.id">{{ item.name }} </a-select-option>
          </a-select>
        </a-form-item>
      </a-form>
      <a-row style="margin-top: 50px">
        <a-col :span="4" :offset="10">
          <a-button type="primary" size="large" @click="advancedSearch">搜索</a-button>
        </a-col>
      </a-row>
    </a-drawer>
    <!-- 新增订单 -->
    <a-modal width="800px" v-model:visible="orderPop" title="新增订单" @ok="saveOrder" @cancle="cancleOrder">
      <a-form ref="formRef" style="padding-top: 20px" :model="orderForm" :rules="orderRule" :hideRequiredMark="true" :label-col="labelCol">
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="serviceName" label="服务名称">
              <view class="df">
                <!-- <a-input v-model:value="orderForm.serviceName" placeholder="" style="width: 80%;">
								</a-input> -->
                <a-cascader
                  v-model:value="orderForm.value1"
                  :options="optionsServe"
                  :show-search="{ filter }"
                  placeholder="请选择服务名称"
                  @change="handleServe"
                />
                <!-- <a-cascader v-model:value="orderForm.value1" @change="handleServe"
									:options="optionsServe" /> -->
              </view>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="institution" label="渠道名称">
              <a-input v-model:value="orderForm.institution" placeholder="请输入渠道名称"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="userName" label="用户姓名">
              <a-input maxLength="10" v-model:value="orderForm.userName" placeholder="请输入用户姓名"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="mobile" label="手机号码">
              <a-input v-model:value="orderForm.mobile" placeholder="请输入手机号码"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="orderPrice" label="订单金额">
              <a-input v-model:value="orderForm.orderPrice" placeholder="请输入订单金额"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="calculatePrice" label="结算金额">
              <a-input v-model:value="orderForm.calculatePrice" placeholder="请输入结算金额"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="consumablesCost" label="耗材费用">
              <a-input v-model:value="orderForm.consumablesCost" placeholder="请输入耗材费用"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="scheduleTime" label="服务时间">
              <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="orderForm.scheduleTime" />
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="num" label="服务次数">
              <a-input type="number" v-model:value="orderForm.num" placeholder="请输入服务次数"></a-input>
            </a-form-item>
          </a-col>

          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="city" label="服务城市">
              <a-cascader v-model:value="orderForm.city" :options="provinceOption" placeholder="请选择服务城市" change-on-select />
            </a-form-item>

            <!-- :show-search="{ filterOpt }"  -->
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="address" label="详细地址">
              <a-input maxLength="30" v-model:value="orderForm.address" placeholder="请输入服务详细地址"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="whetherPositioning" label="是否定位">
              <a-select v-model:value="orderForm.whetherPositioning" placeholder="限制三百米内打卡">
                <a-select-option v-for="(item, index) in isPosition" :value="item.value" :key="index">{{ item.label }} </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="estimatedArrivalStatus" label="佣金到账时间">
              <a-select v-model:value="orderForm.estimatedArrivalStatus" placeholder="请选择到账时间">
                <a-select-option v-for="(item, index) in moneyOption" :value="item.value" :key="index">{{ item.label }} </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="isSend" label="开启会员通知">
              <a-select v-model:value="orderForm.isSend" placeholder="是否开启">
                <a-select-option v-for="(item, index) in sendOption" :value="item.value" :key="index">{{ item.label }} </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
        </a-row>
        <!--  -->
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="idCard" label="身份证号">
              <a-input v-model:value="orderForm.idCard" placeholder="请输入身份证号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="urgentContact" label="紧急电话">
              <a-input v-model:value="orderForm.urgentContact" placeholder="请输入紧急电话"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="allergy" label="过敏史">
              <a-input v-model:value="orderForm.allergy" placeholder="请输入过敏史"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="genetic" label="遗传史">
              <a-input v-model:value="orderForm.genetic" placeholder="请输入遗传史"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="bloodType" label="血型">
              <!-- <a-input
                v-model:value="orderForm.bloodType"
                placeholder="请输入血型"
              ></a-input> -->
              <a-select ref="select" v-model:value="orderForm.bloodType">
                <a-select-option v-for="(item, index) in publish" :value="item" :key="index">{{ item }} </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="height" label="身高(cm)">
              <a-input v-model:value="orderForm.height" placeholder="请输入身高"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="weight" label="体重(kg)">
              <a-input v-model:value="orderForm.weight" placeholder="请输入体重"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="bloodSugar" label="血糖(mmol/L)">
              <a-input v-model:value="orderForm.bloodSugar" placeholder="请输入血糖"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="20">
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="bloodPressure" style="display: flex" label="血压(mmHg)">
              <a-input style="display: inline !important" v-model:value="orderForm.bloodPressure1" placeholder="低压"></a-input>
              <a-input style="display: inline !important" v-model:value="orderForm.bloodPressure2" placeholder="高压"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item style="display: flex" label="医院名称">
              <a-input style="display: inline !important" v-model:value="orderForm.hospital" placeholder="请输入医院名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item style="display: flex" label="科室信息">
              <a-input style="display: inline !important" v-model:value="orderForm.departmentInfo" placeholder="请输入科室信息"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item style="display: flex" label="公里数">
              <a-input style="display: inline !important" v-model:value="orderForm.kilometer" placeholder="请输入公里数"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item style="display: flex" label="车辆类型">
              <a-select v-model:value="orderForm.carType" placeholder="请选择车辆类型">
                <a-select-option v-for="(item, index) in carOption" :value="item.label" :key="index">{{ item.label }} </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="12" :lg="12" :xs="10">
            <a-form-item name="otherInfo" label="备注">
              <a-input maxLength="100" v-model:value="orderForm.otherInfo" placeholder="请输入备注"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row>
          <a-form-item label="医嘱" name="proveJson">
            <a-upload
              v-model:file-list="contentImg"
              list-type="picture-card"
              class="avatar-uploader"
              :maxCount="4"
              :customRequest="uploadDetail_imgPath"
            >
              <div v-if="contentImg.length < 4" class="ant-upload-text">
                <plus-outlined />
              </div>
            </a-upload>
          </a-form-item>
        </a-row>
      </a-form>
    </a-modal>
  </div>
</template>
<script>
import { reactive, ref, watch, computed, defineComponent, onMounted, createVNode, toRefs, getCurrentInstance, onActivated } from 'vue'
import { debounce } from '@/assets/js/debounceThrottle.js'
import {
  CheckOutlined,
  EditOutlined,
  ArrowDownOutlined,
  ArrowUpOutlined,
  ExclamationCircleOutlined,
  EditTwoTone,
  DeleteTwoTone,
  UploadOutlined
} from '@ant-design/icons-vue'
import { channel, mystatus } from '@/utils/dict.js'
import { message, Modal } from 'ant-design-vue'
import { useRoute, useRouter } from 'vue-router'
import {
  selectAllOrder,
  modifyOrderStatus,
  selectServiceInfoById,
  createOnlineOrder,
  selectAllOrderExport,
  updatePeopleMobile,
  selectPeopleMobile,
  updateOrderIsShow,
  selectOneOrder,
  selectAllOrderIds
} from '../../../api/order/index.js'

import { selectCityByProvinceCode, selectProvince } from '@/api/common/index'
import { deleteObjBlank } from '@/assets/js/common.js'
import { uploadPicture } from '@/api/service/index.js'
import router from '@/router/index.js'
import { checkPermission } from '@/router/permission' // 权限判断函数
import permission from '@/directive/permission/index.js' //权限判断指令
import { useModal, useSelects } from '@/hooks'
import { url } from '@/utils/options'
import uploadOrder from '../components/uploadOrder.vue'
import areaData from '@/assets/js/area.json'
export default {
  name: 'OrderIndex',
  setup() {
    const router = useRouter()
    // 分页器
    const page = reactive({
      current: 1,
      pageSize: 10,
      total: 0
    })
    let advancedForm = reactive({})
    const formRef = ref('')
    const data = reactive({
      uploadVisible: false,
      provinceOption: [],
      telVisible: false,
      mytel: '',
      mytel1: '',
      mystatus: mystatus,
      channel: channel,
      loading: ref(true), //表格的加载
      visible: false,
      sliderValue: [0, 1000],
      orderTime: [],
      orderStatusAct: 0, //订单状态激活
      refundStatus: -1, //退款状态下，0，1
      // searchType:0//查询type类型
      advance: false,
      status: '', //订单状态
      editVisible: false,
      number: '', //订单编号
      orderPop: false,
      orderForm: {
        // createOrderJson: {
        //   hospital: ''
        // }
      }, //订单列表
      optionsServe: [],
      contentImg: [],
      publish: ['A', 'B', 'O', 'AB'],
      isPosition: [
        { label: '跳过定位', value: 3 },
        { label: '需要定位', value: 0 }
      ],
      carOption: [{ label: '商务车' }, { label: '救护车' }, { label: '普通轿车' }, { label: '火车票' }, { label: '机票' }],
      moneyOption: [
        { label: '立即到账', value: 1 },
        { label: '7天后到账', value: 2 }
      ],
      sendOption: [
        { label: '开启', value: 0 },
        { label: '关闭', value: 1 }
      ],
      listPage: 1,
      toListPage: 1,
      toAdvancedForm: '',
      toForm: '',
      listStatus: 0,
      editListInfo: {}
    })
    // 最低金额-最高金额(监听最低金额吧要)
    const maxPrice = computed(() => {
      // console.log(advancedForm.startPrice, "最小金额是");
      return advancedForm.startPrice + 0.01
    })
    const filter = (inputValue, path) => {
      console.log('123123')
      return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
    }
    const form = reactive({
      userName: '',
      userId: '',
      number: '',
      mobile: ''
    })

    const marks = ref({
      0: '0',
      1000: {
        style: {
          color: '#f50'
        },
        label: '1000'
      }
    })
    const selectTime = (e, dateString) => {
      // console.log(dateString, "时间是-----");
      advancedForm.startTime = dateString[0]
      advancedForm.endTime = dateString[1]
    }
    // 订单状态列表
    const orderStatus = [
      {
        title: '全部',
        status: 0
      },
      {
        title: '待付款',
        status: 1
      },
      {
        title: '待抢单',
        status: 2
      },
      {
        title: '待服务',
        status: 3
      },
      {
        title: '服务中',
        status: 4
      },
      {
        title: '已完成',
        status: 5
      },
      {
        title: '已取消',
        status: 6
      },
      // { title: "已退款", status: 7 },
      {
        title: '全额退款',
        status: 7,
        refundStatus: 0
      },
      {
        title: '部分退款',
        status: 9,
        refundStatus: 1
      },
      {
        title: '异常单',
        status: 8
      }
    ]
    const colums = [
      {
        title: '订单号',
        dataIndex: 'number',
        className: 'table',
        align: 'center'
      },
      {
        title: '用户姓名',
        dataIndex: 'userName',
        className: 'table',
        align: 'center',
        slots: {
          customRender: 'sort'
        }
      },
      {
        title: '用户ID',
        dataIndex: 'userId',
        className: 'table'
      },
      {
        title: '用户手机号',
        dataIndex: 'mobile',
        className: 'table'
      },
      {
        title: '订单金额',
        dataIndex: 'price',
        className: 'table',
        slots: {
          customRender: 'price'
        }
      },

      {
        title: '服务城市',
        dataIndex: 'address',
        className: 'table',
        maxWidth: 100,
        ellipsis: true
      },
      {
        title: '服务名称',
        dataIndex: 'serveName',
        className: 'table'
      },
      {
        title: '渠道名称',
        dataIndex: 'institution',
        className: 'table',
        align: 'center'
      },
      {
        title: '抢单',
        dataIndex: 'isShow',
        className: 'table',
        slots: {
          customRender: 'isShow'
        },
        align: 'center'
      },

      {
        title: '通话记录',
        dataIndex: 'callStatus',
        className: 'table',
        slots: {
          customRender: 'callStatus'
        },
        align: 'center'
      },
      {
        title: '下单时间',
        dataIndex: 'createdAt',
        className: 'table',
        sorter: (a, b) => {
          const aTime = new Date(a.createdAt).getTime()
          const bTime = new Date(b.createdAt).getTime()
          return aTime - bTime
        }
      },
      {
        title: '服务次数',
        dataIndex: 'serveNumber',
        className: 'table',
        sorter: true,
        sorter: (a, b) => a.serveNumber - b.serveNumber,
        align: 'center'
      },
      {
        title: '订单状态',
        dataIndex: 'status',
        className: 'table',
        slots: {
          customRender: 'status'
        },
        align: 'center'
      },
      {
        title: '护士所属机构',
        dataIndex: 'titleOfNurse',
        className: 'table',
        align: 'center'
      },
      {
        title: '护士姓名',
        dataIndex: 'nurseName',
        className: 'table',
        align: 'center'
      },
      {
        title: '操作',
        dataIndex: 'operation',
        className: 'table',
        fixed: 'right',
        // width: 150,
        // align: "center",
        slots: {
          customRender: 'operation'
        },
        align: 'center'
      }
    ]

    const handleChange = info => {
      if (info.file.status !== 'uploading') {
        console.log(info.file, info.fileList)
      }
      if (info.file.status === 'done') {
        message.success(`${info.file.name} 上传成功`)
        init()
      } else if (info.file.status === 'error') {
        message.error(`${info.file.name} 上传失败.`)
      }
    }

    // 订单列表对应的状态
    const orderListStatusColor = computed(status => {
      return function (status) {
        if (status == 6) {
          return 'default'
        }
        if (status == 5) {
          return 'success'
        }
        if (status == 2) {
          return '#f50'
        }
        if (status == 3) {
          return 'warning'
        }
        if (status == 7) {
          return 'blue'
        }
        if (status == 1 || status == 9 || status == 10) {
          return 'error'
        }
      }
    })
    const orderRule = {
      serviceName: [
        {
          required: true,
          message: '请选择'
        }
      ],

      whetherPositioning: [
        {
          required: true,
          message: '请选择'
        }
      ],
      estimatedArrivalStatus: [
        {
          required: true,
          message: '请选择'
        }
      ],
      isSend: [
        {
          required: true,
          message: '请选择'
        }
      ],
      userName: [
        {
          required: true,
          message: '请输入'
        }
      ],
      institution: [
        {
          required: true,
          message: '请输入'
        }
      ],
      mobile: [
        {
          required: true,
          message: '请输入'
        },
        {
          pattern: /^1[0-9]\d{9}$/,
          message: '请输入正确格式'
        }
      ],
      orderPrice: [
        {
          required: true,
          message: '请输入'
        },
        {
          pattern: /^([1-9]\d*(\.\d*[1-9])?)|(0\.\d*[1-9])$/,
          message: '请输入大于0的数'
        }
      ],
      calculatePrice: [
        {
          required: true,
          message: '请输入'
        },
        {
          pattern: /^([1-9]\d*(\.\d*[1-9])?)|(0\.\d*[1-9])$/,
          message: '请输入大于0的数'
        }
      ],
      scheduleTime: [
        {
          required: true,
          message: '请选择'
        }
      ],
      city: [
        {
          required: true,
          message: '请选择'
        }
      ],
      num: [
        {
          required: true,
          message: '请输入'
        },
        {
          pattern: /^[1-9]{1}\d{0,10}$/,
          message: '请输入大于0的整数'
        }
      ],
      address: [
        {
          required: true,
          message: '请输入'
        }
      ],
      idCard: [
        {
          pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
          message: '请输入正确的身份证格式'
        }
      ]
    }
    const orderListStatus = status => {
      let title = ''
      switch (status) {
        case 1:
          title = '待付款'
          break
        case 2:
          title = '待抢单'
          break
        case 3:
          title = '待服务'
          break
        case 4:
          title = '服务中' //服务中
          break
        case 5:
          title = '已完成'
          break
        case 6:
          title = '已取消'
          break
        case 7:
          title = '已退款'
          break
        case 8:
          title = '异常单'
          break
        case 9:
          title = '退款中' //退款中
          break
        case 10:
          title = '已拒绝' //已拒绝
          break
        default:
          break
      }
      return title
    }
    // 选择订单状态查询
    const chooseOrderStatus = (item, index) => {
      console.log('chooseOrderStatus', item, index)
      console.log('CLASSorderStatusAct', data.orderStatusAct)
      if (item.status == 7 || item.status == 9) {
        data.refundStatus = item.refundStatus
      } else {
        data.refundStatus = -1
      }
      data.orderStatusAct = item.status
      page.current = 1
      init()
    }
    const close = () => {
      console.log('点击了关闭')
      data.visible = false
      // advancedForm.serviceName = "";
      // advancedForm.serveNumber = 1;
    }
    const getSelectAllOrderIds = obj => {
      selectAllOrderIds(obj).then(res => {
        renderData.value = res.object
      })
    }

    // const getSelectProvince = () => {
    //   selectProvince().then(res => {
    //     res.object.forEach(item => (item.isLeaf = false))
    //     data.provinceOption = res.object
    //   })
    // }
    // getSelectProvince()
    const initAreaData = () => {
      // 转换数据格式以适配lb-picker
      data.provinceOption = areaData.map(province => ({
        label: province.province,
        value: province.province,
        children: province.citys.map(city => ({
          label: city.city,
          value: city.city,
          children: city.areas.map(area => ({
            label: area.area,
            value: area.area
          }))
        }))
      }))
    }
    initAreaData()

    const loadData = selectedOptions => {
      console.log('12332432')
      const targetOption = selectedOptions[selectedOptions.length - 1]
      targetOption.loading = true
      console.log(targetOption)
      selectCityByProvinceCode({ provinceCode: targetOption.provinceCode }).then(res => {
        targetOption.loading = false
        res.object.forEach(item => {
          item.provinceName = item.cityName
          item.provinceCode = item.cityCode
        })
        targetOption.children = res.object
      })
    }

    const editStatus = async (
      aiPuDiKangNumber,
      createdAt,
      serveNumber,
      number,
      status,
      calculatePrice,
      institution,
      isEditNeed,
      scheduleTime,
      price,
      address
    ) => {
      let res = await selectOneOrder(number)
      if (res.success) {
        if (res.object.object.status != status) {
          message.config({
            duration: 0
          })
          message.error('最新订单状态改变，即将刷新页面，请重新进行编辑操作！')
          setTimeout(function () {
            location.reload()
          }, 2000)
        }
      }
      const { object } = res.object
      data.editListInfo = {
        aiPuDiKangNumber: aiPuDiKangNumber,
        createdAt: createdAt,
        ordersList: res.object.object.sonOrders,
        serveNumber: serveNumber,
        number: number,
        status: status,
        calculatePrice: calculatePrice,
        institution: institution,
        isEditNeed: isEditNeed,
        scheduleTime: scheduleTime,
        price: price,
        address: res.object.object.address,
        descAddress: (object.economize || '') + (object.addressCity || '') + (object.distinguish || '') + (object.distinguish || '')
      }
      console.log('data.editListInfo', data.editListInfo)
      data.editVisible = true
    }
    const saveOrder = debounce(
      async () => {
        console.log('城市', data.orderForm.city)
        // return
        console.log('data.orderForm', data.orderForm)

        if (data.contentImg.length > 0) {
          let arr = data.contentImg.map(m => {
            return m.url
          })
          data.orderForm.proveJson = arr.join(',')
        }
        if (data.orderForm.bloodPressure1 || data.orderForm.bloodPressure2) {
          data.orderForm.bloodPressure = (data.orderForm.bloodPressure2 || 0) + '/' + (data.orderForm.bloodPressure1 || 0)
        }

        console.log(data.number, data.status, '订单状态----')
        formRef.value.validate().then(async () => {
          // if (Number(data.orderForm.orderPrice) < Number(data.orderForm.calculatePrice)) {
          //   message.error('结算的金额不能比订单金额大')
          //   return
          // }
          // 拼接省市区地址
          const city = data.orderForm.city
          if (city.length >= 2) {
            data.orderForm.economize = city[0]
            data.orderForm.addressCity = city[1]
            data.orderForm.distinguish = city[2]
          } else {
            message.warning('请选择服务城市')
          }
          console.log(data.orderForm)

          // return
          // 后端说来不及加字段
          let createOrderJson = {
            hospital: data.orderForm.hospital,
            departmentInfo: data.orderForm.departmentInfo,
            kilometer: data.orderForm.kilometer,
            carType: data.orderForm.carType
          }
          data.orderForm.createOrderJson = JSON.stringify(createOrderJson)
          console.log('表单', data.orderForm)
          let res = await createOnlineOrder({
            ...data.orderForm
          })
          if (res.success) {
            message.success('操作成功~')
            data.orderPop = false
            data.orderForm = {}
            data.contentImg = []
            formRef.value.resetFields()

            init()
          }
        })
      },
      2000,
      true
    )
    const cancleOrder = () => {
      data.contentImg = []
      data.orderForm = {}
      formRef.value.resetFields()
    }
    const handleServe = value => {
      data.orderForm.serviceId = value[0]
      data.orderForm.serviceName = value[1]
      // console.log(value,'0000000000000')
    }
    const saveStatus = async () => {
      console.log(data.editListInfo, '订单状态----')
      data.editListInfo.createdAt = data.editListInfo.createdAt.replace(/-/g, '/')
      if (data.editListInfo.isEditNeed == 1 && data.editListInfo.calculatePrice > 0 && data.editListInfo.price > 0) {
        console.log('创建订单', data.editListInfo.isEditNeed)
        editOrderInfo()
      } else if (data.editListInfo.isEditNeed == 0 || data.editListInfo.isEditNeed == null) {
        console.log('app小程序', data.editListInfo.isEditNeed)
        editOrderInfo()
      } else {
        message.warning('金额应大于0！')
      }
    }
    const editOrderInfo = async () => {
      let res = await modifyOrderStatus(data.editListInfo)
      if (res.success) {
        message.success('修改成功~')
        data.editVisible = false
        init()
      }
    }
    // 全选反选
    const { renderData, rowSelection } = useSelects({})
    //
    onActivated(() => {
      init()
    })

    // 分页器/-
    const pagination = computed(() => ({
      current: page.current,
      pageSize: page.pageSize,
      pageSizeOptions: ['10', '20', '30'],
      showTotal: (total, range) => {
        return '共' + total + '条'
      },
      total: page.total,
      showQuickJumper: true,
      showSizeChanger: true
    }))

    // 分页器改变的时候
    const handleTableChange = (pagination, filters, sorter) => {
      console.log('当前分页是', page.current)
      page.current = pagination.current
      data.listPage = page.current
      page.pageSize = pagination.pageSize

      console.log(data.orderStatusAct, '订单状态是')
      // if (data.orderStatusAct != 0) {
      //   init({ status: data.orderStatusAct });
      // }
      // 请求列表接口

      if (data.advance) {
        // 如果是高级查询
        init(advancedForm)
      } else {
        console.log('普通搜索1111111111111111111')
        // page.current = 1
        init()
      }
      // 请求列表接口
    }

    const openDrawer = () => {
      data.visible = true
      data.advancedForm = {}
    }
    // 高级筛选
    const advancedSearch = () => {
      console.log(advancedForm, '高级搜索----')
      if (Object.keys(advancedForm).length == 0) {
        message.warning('请输入你要搜索的内容！！！')
        return
      }
      page.current = 1
      data.loading = true
      data.toListPage = 1
      data.toForm = ''
      data.listStatus = 0
      data.toAdvancedForm = ''
      rowSelection.selectedRowKeys = []
      // 删除对象中为空的属性
      init(deleteObjBlank(advancedForm))
      data.advance = true

      close()
    }

    // 导出数据
    const excleData = () => {
      if (rowSelection.selectedRowKeys.length == 0) {
        message.warning('请选择你要导出的订单')
        return
      }
      const { closeModal } = useModal.confirm({
        title: `确认导出当前${rowSelection.selectedRowKeys.length}条数据吗?`,

        icon: createVNode(ExclamationCircleOutlined),
        onOk() {
          let obj = {
            status: data.orderStatusAct, //订单状态
            ...form,
            ...advancedForm,
            orderIds: rowSelection.selectedRowKeys
          }

          selectAllOrderExport({
            ...obj
          }).then(res => {
            console.log(res)
            let link = document.createElement('a')
            //创建一个a标签
            link.style.display = 'none'
            //将a标签隐藏
            link.href = res.object
            //给a标签添加下载链接  "域名+接口"  safe是一个动态的域名  后面的接口替换成你自己的下载接口
            link.setAttribute('download', '订单')
            // 此处注意，要给a标签添加一个download属性，属性值就是文件名称 否则下载出来的文件是没有属性的，空白白
            document.body.appendChild(link)
            //将上面创建的a标签加入到body的尾部
            link.click()
            closeModal()
          })
        },
        class: 'test'
      })
    }

    // 处理订单
    const deal = (e, status, isEdit, listStatus, listPage, form, advancedForm) => {
      console.log('处理9999999999999', form, listStatus, listPage, advancedForm)
      if (data.toForm != '') {
        handleForm(data.toForm)
      }
      if (data.toAdvancedForm != '') {
        advancedForm = data.advancedForm
      }
      form = JSON.stringify(form)
      advancedForm = JSON.stringify(advancedForm)
      listStatus = data.orderStatusAct
      console.log('listStatus', listStatus)
      router.push({
        path: '/order/center/order-detail',
        query: {
          number: e,
          status: status,
          isEdit: isEdit,
          listStatus: listStatus,
          form: form,
          advancedForm: advancedForm,
          listPage: listPage
        }
      })
    }
    // 查看订单
    const look = (e, status, isEdit, listStatus, listPage, form, advancedForm) => {
      console.log('查看9999999999999', form, listStatus, listPage)
      if (data.toForm != '') {
        handleForm(data.toForm)
      }
      if (data.toAdvancedForm != '') {
        advancedForm = data.advancedForm
      }
      form = JSON.stringify(form)
      console.log(form)
      advancedForm = JSON.stringify(advancedForm)
      listStatus = data.orderStatusAct

      router.push({
        path: '/order/center/order-detail',
        query: {
          number: e,
          status: status,
          isEdit: isEdit,
          listStatus: listStatus,
          form: form,
          advancedForm: advancedForm,
          listPage: listPage
        }
      })
    }
    const changeStack = (checked, index, id) => {
      console.log(page.pageNum)
      console.log(checked, index, '是否上下架')
      let title = checked == 0 ? '可抢' : '不可抢'
      // 弹框提示？确定上下架吗
      const { closeModal } = useModal.confirm({
        title: () => `确认${title}此订单吗？?`,
        icon: () => createVNode(ExclamationCircleOutlined),
        onOk: async () => {
          let res = await updateOrderIsShow({
            number: id,
            status: checked
          })
          if (res.success) {
            init()
            closeModal()
          } else {
            let flag = checked == 0 ? 3 : 0
            order.list[index].isShow = flag
          }
        },
        onCancel() {
          let flag = checked == 0 ? 3 : 0
          order.list[index].isShow = flag
          closeModal()
        },
        class: 'test'
      })
    }
    // ref修饰的时候才是响应式的才可以改变为何reactive不行呢？
    const order = reactive({
      list: []
    })
    let detailUrl = decodeURI(router.options.history.state.forward)
    if (detailUrl != null) {
      let sta = detailUrl.indexOf('order-detail') != -1
      // console.log("sta", detailUrl)
      if (sta) {
        let detailUrlLength = detailUrl.length
        let detailUrlLocation = detailUrl.lastIndexOf('=')
        let endData = detailUrl.substr(detailUrlLocation + 1, detailUrlLength - detailUrlLocation)
        data.toListPage = endData
        data.listPage = endData
        let formLocationStart = findStr(detailUrl, '=', 4) + 1
        let formLocation = findStr(detailUrl, '&', 4)
        data.toForm = detailUrl.substring(formLocation, formLocationStart)
        let statusLocationStart = findStr(detailUrl, '=', 3) + 1
        let statusLocation = findStr(detailUrl, '&', 3)
        data.orderStatusAct = detailUrl.substring(statusLocation, statusLocationStart)
        let advanceLocation = detailUrl.lastIndexOf('&')
        let advanceLocationStart = detailUrl.lastIndexOf('=', detailUrl.lastIndexOf('=') - 1) + 1
        data.toAdvancedForm = detailUrl.substring(advanceLocationStart, advanceLocation)
        data.advancedForm = JSON.parse(data.toAdvancedForm)
        handleForm(data.toForm)
        // console.log( '列表订单状态', data.listStatus, "高级搜索", data.advancedForm, '普通搜索', form)
      }
      // init()
    }
    // 初始化全部订单数据
    async function init(search) {
      console.log('search', search)
      // console.log(111, data.toAdvancedForm, 222, data.toForm)
      // console.log(222, data.advancedForm, 333, data.form)
      if (typeof search == 'undefined') {
        if (data.toAdvancedForm != '{}') {
          // console.log("高级");
          search = data.advancedForm
        } else if (data.toForm != '{}') {
          // console.log("普通");
          handleForm(data.toForm)
        }
      }
      data.loading = true
      deleteObjBlank(form)
      let obj = {
        pageNum: page.current,
        pageSize: page.pageSize,
        status: data.orderStatusAct, //订单状态
        ...form,
        ...search //高级表单
      }

      if (data.refundStatus != -1) {
        obj.refundStatus = data.refundStatus
        delete obj.status
      }
      // 请求当前查询状态下的id
      getSelectAllOrderIds(obj)
      let res = await selectAllOrder(obj)
      if (res.success) {
        order.list = res.object.list.map(m => {
          if (m.isShow != 3) {
            m.isShow = 0
          }
          if (m.nurseName == null || m.nurseName == '') {
            m.nurseName = '暂无'
          }
          console.log(m.institution)
          if (m.titleOfNurse == null) {
            if (m.institution == 'app' || m.institution == '微信小程序' || m.institution == '京东健康') {
              m.titleOfNurse = '湖州护理站'
            } else {
              m.titleOfNurse = m.institution
            }
          }
          return m
        })
        res.object.list.map(el => (el.key = el.number))
        page.total = res.object.total
        // renderData.value = res.object.allOrderIds;
        data.loading = false
      } else {
        data.loading = false
      }
    }

    function findStr(str, cha, num) {
      let x = str.indexOf(cha)
      for (let i = 0; i < num; i++) {
        x = str.indexOf(cha, x + 1)
      }
      return x
    }

    function handleForm(str) {
      let a = JSON.parse(str)
      console.log('aaaaaa', a, a.mobile, a.userId, a.number, a.userName)
      if (typeof a.mobile != undefined) {
        console.log('mobile1111')
        form['mobile'] = a.mobile
      }
      if (typeof a.userId != undefined) {
        console.log('userid222')
        form['userId'] = a.userId
      }
      if (typeof a.number != undefined) {
        console.log('number333')
        form['number'] = a.number
      }
      if (typeof a.userName != undefined) {
        console.log('userName444')
        form['userName'] = a.userName
      }
    }
    const emitOrder = () => {
      init()
    }
    const search = () => {
      console.log(form, '搜索表单内容是')
      if (Object.keys(form).length == 0) {
        message.warning('请输入你要搜索的内容！！！')
        return
      }
      page.current = 1
      data.loading = true
      data.toListPage = 1
      data.toForm = ''
      data.listStatus = 0
      data.toAdvancedForm = ''
      console.log('初始化页数', page.current)
      rowSelection.selectedRowKeys = []

      init()
    }
    const handleTelPop = () => {
      selectPeopleMobile({}).then(r => {
        data.mytel1 = r.object.smsContent
      })

      data.telVisible = true
    }
    const handleTel = () => {
      updatePeopleMobile({
        mobile: data.mytel
      }).then(r => {
        if (r.success) {
          message.success('修改成功')
        } else {
          message.error('修改成功')
        }
        data.telVisible = false
      })
    }
    const handleOrderPop = () => {
      data.contentImg = []
      data.orderForm = {}
      data.orderPop = true
      formRef.value.resetFields()
      getSelectServiceInfoById()
    }
    const getSelectServiceInfoById = () => {
      selectServiceInfoById().then(r => {
        let arr = r.object.map(o => {
          if (o.sonServicesList) {
            o.sonServicesList = o.sonServicesList.map(s => {
              s.value = s.sonServiceName
              s.label = s.sonServiceName
              return s
            })
          }
          return o
        })
        data.optionsServe = arr.map(m => {
          let obj = {
            value: m.id,
            label: m.name,
            children: [...m.sonServicesList]
          }
          return obj
        })

        console.log(data.optionsServe, ' data.optionsServe data.optionsServe data.optionsServe')
      })
    }
    getSelectServiceInfoById()
    const uploadDetail_imgPath = file => {
      uploadImage(file, 'contentImg')
    }
    // 公共的上传图片
    const uploadImage = async (file, e) => {
      let formData = new FormData()
      formData.append('file', file.file)
      let res = await uploadPicture(formData, 'ali')
      // // url存入列表中,为什么是两个fileList
      data[e] = data[e].filter(el => el.status == 'done')
      if (res.success) {
        data[e].push({
          uid: file.file.uid,
          url: res.object,
          status: 'done',
          name: file.file.name
        })
      }
      // console.log(data[e], "data[e]是--");
    }
    onMounted(() => {
      // console.log(
      //   "onMountedonMountedonMounted",
      //   data.toListPage,
      //   data.toForm,
      //   data.toAdvancedForm
      // );
      if (
        data.toListPage != 1 ||
        data.listStatus != 0 ||
        data.toForm != '{}' ||
        data.toAdvancedForm != '{}' ||
        data.toForm == '' ||
        data.toAdvancedForm == ''
      ) {
        page.current = data.toListPage
        // console.log("toListPage页数", page.current);
        // data.orderStatusAct = data.listStatus
        // console.log(22222222222);
        if (data.toAdvancedForm != '{}' && data.toForm == '{}') {
          console.log('高级筛选00000000000000')
          console.log(data.advancedForm)
          init(data.advancedForm)
        } else if (data.toForm != '{}' && data.toAdvancedForm == '{}') {
          console.log('普通搜索11111111111111')
          // handleForm(data.toForm)
          init()
        }
      } else if (
        data.toListPage == 1 &&
        (data.toForm == '{}' || data.toForm == '') &&
        (data.toAdvancedForm == '{}' || data.toAdvancedForm == '')
      ) {
        page.current = data.listPage
        console.log('toListPage页数000', page.current)
        console.log(1111111111111111)
        init()
      }
    })

    return {
      ...toRefs(order),
      ...toRefs(data),
      handleForm,
      findStr,
      form,
      search,
      colums,
      pagination,
      orderStatus,
      chooseOrderStatus,
      handleTableChange,
      rowSelection,
      excleData,
      look,
      deal,
      openDrawer,
      advancedSearch,
      labelCol: {
        style: {
          fontWeight: 'bold',
          width: '100px'
        }
      },
      advancedForm,
      // sliderValue,
      marks,
      // changeOrderNumber,
      orderListStatus,
      orderListStatusColor,
      selectTime,
      close,
      maxPrice,
      editStatus,
      saveStatus,
      editOrderInfo,
      checkPermission,
      handleOrderPop,
      handleChange,
      saveOrder,
      cancleOrder,
      handleServe,
      uploadDetail_imgPath,
      orderRule,
      formRef,
      handleTel,
      handleTelPop,
      changeStack,
      filter,
      handleResizeColumn: (w, col) => {
        col.width = w
      },
      emitOrder,
      loadData
    }
  },

  name: 'OrderIndex',

  components: {
    CheckOutlined,
    EditOutlined,
    ExclamationCircleOutlined,
    EditTwoTone,
    DeleteTwoTone,
    ArrowUpOutlined,
    ArrowDownOutlined,
    UploadOutlined,
    uploadOrder
  },

  directives: {
    permission
  }
}
</script>

<style scoped lang="less">
.search {
  background-color: #e6e6e6;
  margin-bottom: 20px;
  padding: 1.6rem;
  font-size: 1rem;

  .user-title {
    font-size: 1.5rem;
    font-weight: bold;
  }

  .user-status {
    text-align: center;
    padding: 12px 0;
    font-size: 1.25rem;
  }

  .user-status-act {
    width: 70%;

    .item-title {
      background-color: #2a9d8f;
      color: #fff;
      border-radius: 20rem;
    }
  }
}

::v-deep.ant-picker {
  width: 100%;
}
</style>
